package com.wingsboat.system.service;

import java.util.List;
import com.wingsboat.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wingsboat.system.mapper.SysSleeperMapper;
import com.wingsboat.system.domain.SysSleeper;
import com.wingsboat.system.service.ISysSleeperService;

/**
 * 轨枕信息Service业务层处理
 * 
 * @author wangzhong
 * @date 2024-06-09
 */
@Service
public class SysSleeperServiceImpl implements ISysSleeperService 
{
    @Autowired
    private SysSleeperMapper sysSleeperMapper;

    /**
     * 查询轨枕信息
     * 
     * @param id 轨枕信息主键
     * @return 轨枕信息
     */
    @Override
    public SysSleeper selectSysSleeperById(Long id)
    {
        return sysSleeperMapper.selectSysSleeperById(id);
    }

    /**
     * 查询轨枕信息列表
     * 
     * @param sysSleeper 轨枕信息
     * @return 轨枕信息
     */
    @Override
    public List<SysSleeper> selectSysSleeperList(SysSleeper sysSleeper)
    {
        return sysSleeperMapper.selectSysSleeperList(sysSleeper);
    }

    /**
     * 新增轨枕信息
     * 
     * @param sysSleeper 轨枕信息
     * @return 结果
     */
    @Override
    public int insertSysSleeper(SysSleeper sysSleeper)
    {
        sysSleeper.setCreateTime(DateUtils.getNowDate());
        return sysSleeperMapper.insertSysSleeper(sysSleeper);
    }

    /**
     * 修改轨枕信息
     * 
     * @param sysSleeper 轨枕信息
     * @return 结果
     */
    @Override
    public int updateSysSleeper(SysSleeper sysSleeper)
    {
        sysSleeper.setUpdateTime(DateUtils.getNowDate());
        return sysSleeperMapper.updateSysSleeper(sysSleeper);
    }

    /**
     * 批量删除轨枕信息
     * 
     * @param ids 需要删除的轨枕信息主键
     * @return 结果
     */
    @Override
    public int deleteSysSleeperByIds(Long[] ids)
    {
        return sysSleeperMapper.deleteSysSleeperByIds(ids);
    }

    /**
     * 删除轨枕信息信息
     * 
     * @param id 轨枕信息主键
     * @return 结果
     */
    @Override
    public int deleteSysSleeperById(Long id)
    {
        return sysSleeperMapper.deleteSysSleeperById(id);
    }
}
